package com.tianpengtech.front.mobile.region;

import com.jfinal.kit.StrKit;
import com.tianpengtech.front.mobile.common.util.R;
import com.tianpengtech.front.web.common.controller.BaseController;

/**
 * Created by ggd on 2017/7/24 0024.
 */
public class MobileRegionController extends BaseController {

    private static RegionService service = RegionService.me;
    /**
     *  省列表
     */
    public void index(){
        renderJson(service.getProvince());
    }


    /**
     * 获取省下的市
     */
    public void getCity(){
        String id=getPara("id");
        if (StrKit.isBlank(id)){
            renderJson(R.fail("id不能为空"));
            return;
        }
        renderJson(service.getCity(Long.parseLong(id)));
    }
}
